<?php

/**
 * This is the model class for table "{{reply_post}}".
 *
 * The followings are the available columns in table '{{reply_post}}':
 * @property string $rpid
 * @property string $uid
 * @property string $pid
 * @property string $reply_uid
 * @property string $vt_content
 * @property string $create_time
 * @property string $last_modify_time
 * @property string $status
 */
class ReplyPostData extends CActiveRecord
{
    /**
     * Returns the static model of the specified AR class.
     * @return ReplyPostDao the static model class
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

    /**
     * @return string the associated database table name
     */
    public function tableName()
    {
        return '{{reply_post}}';
    }

    /**
     * @return array validation rules for model attributes.
     */
    public function rules()
    {
        // NOTE: you should only define rules for those attributes that
        // will receive user inputs.
        return array(
            array('uid, pid, vt_content, create_time, last_modify_time', 'required'),
            array('uid, pid, reply_uid, vt_content, create_time, last_modify_time, status', 'length', 'max'=>10),
            // The following rule is used by search().
            // Please remove those attributes that should not be searched.
            array('rpid, uid, pid, reply_uid, vt_content, create_time, last_modify_time, status', 'safe', 'on'=>'search'),
        );
    }

    /**
     * @return array relational rules.
     */
    public function relations()
    {
        // NOTE: you may need to adjust the relation name and the related
        // class name for the relations automatically generated below.
        return array(
        );
    }

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels()
    {
        return array(
            'rpid' => 'Rpid',
            'uid' => 'Uid',
            'pid' => 'Pid',
            'reply_uid' => 'Reply Uid',
            'vt_content' => 'Vt Content',
            'create_time' => 'Create Time',
            'last_modify_time' => 'Last Modify Time',
            'status' => 'Status',
        );
    }

    /**
     * Retrieves a list of models based on the current search/filter conditions.
     * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
     */
    public function search()
    {
        // Warning: Please modify the following code to remove attributes that
        // should not be searched.

        $criteria=new CDbCriteria;

        $criteria->compare('rpid',$this->rpid,true);
        $criteria->compare('uid',$this->uid,true);
        $criteria->compare('pid',$this->pid,true);
        $criteria->compare('reply_uid',$this->reply_uid,true);
        $criteria->compare('vt_content',$this->vt_content,true);
        $criteria->compare('create_time',$this->create_time,true);
        $criteria->compare('last_modify_time',$this->last_modify_time,true);
        $criteria->compare('status',$this->status,true);

        return new CActiveDataProvider(get_class($this), array(
            'criteria'=>$criteria,
        ));
    }
}
